<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
    <script>
        window.onload=function(){
            var app=new Vue({
                el:'#app',
                data:{

                },
                methods:{

                },
                components:{
                    'myarticle':{
                        data(){
                            return {
                                user:{
                                    name:'小仙女',
                                    age:18
                                },
                                list:[1,2,3,4,5]

                            }
                        },
                        template:`
                            <div>
                                <p><slot :user='user' :list='list'>hel</slot></p> 
                                <p><slot name='header'>hel</slot></p> 
                                <p><slot name='footer'>hel</slot></p> 
                                <p>hello</p> 
                                <p>world</p> 
                            </div>
                        `
                    }
                }
            })
        }
    </script>
</head>
<body>
    <div id="app">
        <myarticle>
            <template v-slot:default='scope'>
                {{scope.user.name}}--
                {{scope.list}}

            </template>
            <template v-slot:header>
                你好
            </template>
            <template v-slot:footer>
                小仙女
            </template>
            
        </myarticle>
    </div>
</body>
</html>